package com.tech.utils;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public class CollectionsHelper {
	public static final <K, V> Map<K, V> newHashMap() {
		return new HashMap<K, V>();
	}

	public static final <K, V> ConcurrentMap<K, V> newConcurrentMap() {
		return new ConcurrentHashMap<K, V>();
	}

	public static final <T> List<T> newArrayList() {
		return new ArrayList<T>();
	}

	public static final <T> List<T> newLinkedList() {
		return new LinkedList<T>();
	}

	public static final <T> Set<T> newHashSet() {
		return new HashSet<T>();
	}

	public static final <T> List<T> toList(T[] array) {
		List<T> result = new ArrayList<T>(array.length);
		for (T o : array) {
			result.add(o);
		}
		return result;
	}
}
